﻿@model IEnumerable<Domain.Entities.WebManageUsers>
@{
    ViewBag.Title = "Index";
}
<h2>
    用户列表</h2>
<p>
    @Html.ActionLink("建立一个新用户", "Create")
    @Html.ActionLink("上传图像", "FileUpLoad")
    开始日期：<input type="text" id="fromDate" name="fromDate" style="width: 100px;" />
    结果日期：<input type="text" id="toDate" name="toDate" style="width: 100px;" />
    状态:<input type="text" id="status" name="status" value="100" style="width: 30px;" />
    <input type="button" id="search" value="查询" />
    <a href="#" onclick="createOrder()">订单建立</a>
</p>
<table>
    <tr>
        <th>
        </th>
        <th>
            ID
        </th>
        <th>
            登陆账号
        </th>
        <th>
            真实姓名
        </th>
        <th>
            手机
        </th>
        <th>
            邮箱
        </th>
        <th>
            部门
        </th>
        <th>
            子系统
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.ManageUserID }) |
                @Html.ActionLink("Details", "Details", new { id = item.ManageUserID }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.ManageUserID })
            </td>
            <td>
                @item.ManageUserID
            </td>
            <td>
                @item.LoginName
            </td>
            <td>
                @item.RealName
            </td>
            <td>
                @item.Mobile
            </td>
            <td>
                @item.Email
            </td>
            <td>
                @foreach (var subItem in item.WebManageRoles)
                {
                    <span>@subItem.RoleName</span><br />
                }
            </td>
            <td>
                @item.WebSystemID
            </td>
        </tr>
    }
</table>
<script type="text/javascript">
    $("#search").click(function () {
        $.get("/home/index", {
            fromDate: $("#fromDate").val(), toDate: $("#toDate").val(), status: $("#status").val()
        }, function (data) {
            $("body").html(data);
        });
    });

    function createOrder() {
        $.post('/home/createorder', null, function (data) {
            alert(data);
        });
    }
</script>
